﻿
package extremefx.geom {

	/**
	 * @author Marcelo Volmaro
	 */
	public final class Edge {
		public var top:int;
		public var bottom:int;
		public var left:int;
		public var right:int;

		public function Edge(pTop:int = 0, pRight:int = 0, pBottom:int = 0, pLeft:int = 0) {
			top = pTop || 0;
			right = pRight || 0;
			bottom = pBottom || 0;
			left = pLeft || 0;
		}
		
		public function getSize(pContainerW:int, pContainerH:int):Size {
			return new Size(pContainerW - left - right, pContainerH - top - bottom);
		}
		
		public function getWidth(pContainerW:int):int {
			return pContainerW - left - right;
		}
		
		public function getHeight(pContainerH:int):int {
			return pContainerH - top - bottom;
		}
		
		public function toString():String {
			return "("+top+", "+right+", "+bottom+", "+left+")";
		}
	}
}
